#pragma once

#include "Common/Common.h"

#include <QObject>
#include <QMap>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QStandardPaths>
#include <QFileDialog>
#include <QApplication>
#include <QtDebug>
#include <QDir>
#include <QFileInfo>
#include <QDateTime>

class Model : public QObject
{
    Q_OBJECT
public:
    explicit Model(QObject *parent = nullptr);
    virtual ~Model() override;

    Question AddQuestion(const QString &question, const QString &answer);
    void DeleteQuestion(int index);
    void ModifyQuestion(int index, const QString &question, const QString &answer);
    void ModifyQuestionWrongCount(int index, int wrongCount);
    QList<Question> GetQuestionList();
Q_SIGNALS:

private:
    void saveData();
    void loadData();
private:
    QString m_saveDirPath;
    QList<Question> m_questionList;
};
